class HyApi {
  hyApi
  _iframeName
  _option

  constructor(iframeName, option) {
    // 通过iframe的name 拿到 其window
    this._iframeName = iframeName
    this._option = option
    //初始化
    this.start()
    // return {
    //   domName: this._iframeName,
    //   testFunc: this.testFunc,
    //   aa: this.aa,
    //   bb: this.bb
    // }
  }

  start() {
    // 方式一
    // this.hyApi = document.getElementsByName(this._iframeName)[0].contentWindow
    // 方式二
    this.hyApi = window.frames[this._iframeName]
  }

  testFunc() {
    this.hyApi._testModal()
  }

  aa() {
    this.hyApi._modeOutline()
  }

  registDeviceInfoCallback(func) {
    this.hyApi._registDeviceInfoCallback(func)
  }

  cc() {
    const res = this.hyApi._getCameraCoordinate()
    console.log(res)
  }
}
